package ar.edu.uba.fi.jmit.monitorengine;

import java.io.IOException;
import java.util.Properties;

import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

import junit.framework.TestCase;

public abstract class MonitorEngineTestCase extends TestCase {
	
	protected static Logger logger;
	
	public MonitorEngineTestCase() {
		Properties props = new Properties();
		try {
			props.load(this.getClass().getClassLoader().getResourceAsStream("log4j-monitorengine-test.properties"));
		} catch (IOException exception) {
			exception.printStackTrace();
		}
		PropertyConfigurator.configure(props);
		logger = Logger.getLogger(this.getClass());
	}

	protected void fail(Exception e) {
		logger.error(e);
		e.printStackTrace();
		fail(e.getMessage());
	}
	
	@Override
	protected void setUp() throws Exception {
		Constants.setConfigurationsDirectory("./JMitFiles");
	}
}
